package com.damai.hotload;

import java.util.HashMap;
import java.util.Map;

import com.damai.action.ActionMap;
import com.damai.action.Actions;
import com.damai.action.IAction;

import javassist.ClassPool;

public abstract class HotMain  implements IHotModule{
	Map<String, IAction> routeMap = new HashMap<String, IAction>();
	@Override
	public void start(ActionMap map) throws HotLoadException {
		ClassPool pool = new ClassPool(ClassPool.getDefault());
		Actions actions = new Actions(pool,routeMap, map.getInterceptors());
		registerActions(actions);
		map.putAll(routeMap);
	}

	protected abstract void registerActions(Actions actions);

	@Override
	public void stop(ActionMap map) {
		
	}

}
